/**
 * Abstract class for cell-based heightmaps.
 */

#pragma once

#include "Heightmap.h"
#include "Ray.h"
#include "Intersection.h"

class Cell {
public:
    //Returns the minimum height of this cell.
    virtual float getMaxHeight() const = 0;

    //Returns the maximum height of this cell.
    virtual float getMinHeight() const = 0;

    //Traces a ray into this cell. Returns the intersection.
    virtual Intersection traceRay(Ray& ray) const = 0;

    virtual Intersection traceSlopeRay(Ray& slopeRay) const = 0;

    //Traces a shadow ray into this cell. Returns true iff there is a collision.
    virtual bool traceShadowRay(Ray& ray) const = 0;

    virtual void setFromHeightmap(Heightmap& heightmap, int x, int y) = 0;
};
